<!-- [Content] start -->
<div class="content wide">

<h1 id="page"><?php echo $title ?></h1>

<ul class="manage">
	<li><a href="<?php echo site_url('admin/album/settings')?>"><?php echo __("Settings", $module)?></a></li>
	<li><a href="<?php echo site_url('admin/album/create')?>"><?php _e("Create new album", $module)?></a></li>
	<li><a href="<?php echo ($this->uri->segment(3) == 'search') ? site_url('admin/album') : site_url('admin')?>" class="last"><?php _e("Cancel", $module)?></a></li>
</ul>
		
<br class="clearfloat" />

<hr />

<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>

<form method='post' action="<?php echo site_url('admin/album/search') ?>" >
<div class="filter">
<label for="tosearch"><?php echo __("Search album", $module) ?></label>
<input type="text" name="tosearch" id="tosearch" value="<?php if(isset($tosearch)) echo $tosearch ?>" />
<input type="submit" name="submit" value="<?php echo __('Search', $module) ?>" />
</div>
</form>
<table class="page-list">
	<thead>
		<tr>
				<th width="3%" class="center">#</th>
				<th width="22%"><?php echo __("Title", $module)?></th>
				<th width="22%"><?php echo __("Owner", $module)?></th>
				<th width="10%"><?php echo __("Status", $module)?></th>
				<th width="10%" colspan="2"><?php echo __("Ordering", $module)?></th>
				<th width="27%" colspan="3"><?php echo __("Action", $module)?></th>
				<th width="6%" class="last center"><?php echo __("Hits", $module)?></th>
		</tr>
	</thead>
	<tbody>
<?php if ($rows) : ?>
<?php $i = 1; foreach ($rows as $row): ?>
<?php if ($i % 2 != 0): $rowClass = 'odd'; else: $rowClass = 'even'; endif;?>
		<tr class="<?php echo $rowClass?>">
				<td class="center"><?php echo $i?></td>
				<td><?php echo  (strlen($row['title']) > 20? substr($row['title'], 0,20) . '...': $row['title']) ;?></td>
				<td><?php echo $row['username']?></td>
				<td><?php if ($row['active']==1): echo __('Published', $module) ; else: echo __('Draft', $module) ; endif;?></td>
				<td>
				<a href="<?php echo site_url('admin/album/move/up/'. $row['id'] . '/' . $search_id . '/' . $start)?>"><img src="<?php echo site_url('application/views/admin/images/moveup.gif')?>" width="16" height="16" title="<?php echo __("Move up", $module)?>" alt="<?php echo __("Move up", $module)?>"/></a>
				</td><td>
				<a href="<?php echo site_url('admin/album/move/down/'. $row['id']. '/' . $search_id . '/' . $start)?>"><img src="<?php echo site_url('application/views/admin/images/movedown.gif')?>" width="16" height="16" title="<?php echo __("Move down", $module)?>" alt="<?php echo __("Move down", $module)?>"/></a></td>
				<td><a href="<?php echo site_url('album/asehoy/' . $row['aid'])?>" rel="external"><?php echo __('View', $module) ?></a></td>
				<td><a href="<?php echo site_url('admin/'.$module.'/edit/'.$row['id'])?>"><?php echo __('Edit', $module) ?></a></td>
				<td><a href="<?php echo site_url('admin/'.$module.'/delete/'.$row['id'])?>"><?php echo __('Delete', $module) ?></a></td>
				<td class="center"><?php echo $row['hit']?></td>
		</tr>
<?php $i++; endforeach;?>
<?php endif; ?>
	</tbody>
</table>
<?php echo $pager ?>
</div>
<!-- [Content] end -->
